--- implemented negative patterns
module tests.comp.Issue26 where

-- next gives message: "only numeric patterns may be negated"
--wrong (-"bar") = "xx"

foo (-42n) = "Okay"
foo _ = "Not OK"

bar (-42) = "Okay"
bar _ = "Not OK"

baz (-42.0) = "Okay"
baz _  = "Not OK"

main ∷ IO Bool
main = do
    println (foo (-42n))
    println (bar (-42))
    println (baz (-42.0)) 
    pure (foo (-42n) == "Okay" && bar (-42) == "Okay" && baz (-42.0) == "Okay")
